package com.store;

import java.util.ArrayList;
import java.util.List;

import com.jedi.BaseObj;
import com.tss.util.DbConn;
import com.tss.util.DbRs;

public class PalMgr extends BaseObj{
	
	public Pal get(String id) {
		clearErr();
		Pal pal = new Pal();
		DbConn conn = new DbConn();
		try {
			String sql = "";
			sql = "select p.*  from pal p  where p.taskid = ?";
			conn.prepare(sql);
			conn.setString(1,id);
			DbRs rs = conn.executeQuery();
			if (rs == null || rs.size() ==0) return null;
			pal.setCreateman(get(rs,0,"createman"));
			pal.setCreatetime(getDate(rs,0,"createtime"));
			
			pal.setM(getInt(rs,0,"m"));
		
			//pal.setWorktime(getInt(rs,0,"worktime"));
		//	pal.setOutefee(getDouble(rs,0,"outefee"));
			//pal.setSpartfee(getDouble(rs,0,"spartfee"));
			pal.setTaskid(getInt(rs,0,"taskid"));
			//pal.setTripfee(getDouble(rs,0,"tripfee"));
			pal.setY(getInt(rs,0,"y"));
			pal.setMonthin(getInt(rs,0,"monthin"));
			return pal;
		}
		catch(Exception ex) {
			ex.printStackTrace();
			setErr(ex.getMessage());
			return null;
		}
		finally {
			conn.close();
		}
	}

}
